import 'package:flutter/material.dart';
import 'package:lai_zhan/common/style/AppStyle.dart';

/**
 * 描述框
 * 还需要改改
 */
class DescriptionItem extends StatefulWidget {
  String name;
  String description;
  VoidCallback onClick;

  DescriptionItem({this.name, this.description, this.onClick});

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return new _DescriptionItemState();
  }
}

class _DescriptionItemState extends State<DescriptionItem> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Padding(
      padding: EdgeInsets.only(left: 15, right: 15),
      child: new Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          new Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              new Text(
                widget.name,
                style: AppConstant.smallText,
              ),
              new GestureDetector(
                child: new Text(
                  '修改',
                  style: TextStyle(fontSize: AppConstant.smallTextSize,color:Color(AppColors.primaryColor)),
                ),
                onTap: widget.onClick,
              )
            ],
          ),
          new Padding(padding: EdgeInsets.all(6)),
          new Container(
            margin: EdgeInsets.only(left: 6,right: 6),
            child: new Text(widget.description,style: AppConstant.smallText,),
          )
        ],
      ),
    );
  }
}
